<?php
$baner = baner();
?>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<header class="mainHeader">
  <div class="content auto clearfix">
    <div class="logo left">
      <img src="__PUBLIC__/Home/default/static/images/img/logo.png" alt="">
    </div>
    <ul class="slides right clearfix">
      <foreach name="baner" item="vo">
<!--
        <li class="bar active">
-->
          <li class="s bar" >
          <a href="
             <if condition='$vo[name] eq "首页"'>
          {:U('index/index')}
          <elseif condition='$vo[name] eq "专家团队"'/>
          {:U('Expert/index')}
          <elseif condition='$vo[name] eq "新闻资讯"'/>
              {:U('New/index')}
          <elseif condition='$vo[name] eq "招商合作"'/>
              {:U('Investment/index')}
          <elseif condition='$vo[name] eq "培训商城"'/>
              {:U('Shop/index')}
          </if>
">{$vo.name}</a>
        </li>
      </foreach>
    </ul>
  </div>
</header>
<input type="hidden" class="CONTROLLER" value="<?php echo CONTROLLER_NAME;?>"/>
<script>
    $(function()
    {
        $.each($('.s'),function(index,value){
            var CONTROLLER_NAME = $('.CONTROLLER').val()
            if(CONTROLLER_NAME == 'Index')
            {
                if($(this).children().html() == '首页')
                    $(this).attr('class','s bar active')
            }else if(CONTROLLER_NAME == 'Expert')
            {
                if($(this).children().html() == '专家团队')
                    $(this).attr('class','s bar active')
            }else if(CONTROLLER_NAME == 'New')
            {
                if($(this).children().html() == '新闻资讯')
                    $(this).attr('class','s bar active')
            }
            else if(CONTROLLER_NAME == 'Investment')
            {
                if($(this).children().html() == '招商合作')
                    $(this).attr('class','s bar active')
            }
            else if(CONTROLLER_NAME == 'Shop')
            {
                if($(this).children().html() == '培训商城')
                    $(this).attr('class','s bar active')
            }
        });
    })
</script>
